import request from '@/utils/request'

export function getOrganizationList(params) {
  return request({
    url: '/ysOrganization/getOrganizationList',
    method: 'POST',
    data: params
  })
}

// 新增
export function insertOrganization(params) {
  return request({
    url: `/ysOrganization/insertOrganization/${params.year}`,
    method: 'GET'
  })
}

// 发布
export function releaseOrganization(params) {
  return request({
    url: `/ysOrganization/releaseOrganization/${params.year}`,
    method: 'GET'
  })
}

// 查看对应年份详情 - 业务
export function listYsBusinessBudgetDataPage(params) {
  return request({
    url: '/ysBusinessBudgetData/listYsBusinessBudgetDataPage',
    method: 'POST',
    data: params
  })
}

// 编辑 - 业务
export function updateYsBusinessBudgetData(params) {
  return request({
    url: '/ysBusinessBudgetData/updateYsBusinessBudgetData',
    method: 'POST',
    data: params
  })
}

// 导出 - 业务
export function exportExcelYsBusinessBudgetData(params) {
  return request({
    url: '/ysBusinessBudgetData/exportExcelYsBusinessBudgetData',
    method: 'POST',
    params,
    responseType: 'blob'
  })
}

// 查看对应年份详情 - 管理
export function getManageList(params) {
  return request({
    url: '/ysManageBudgetData/getManageList',
    method: 'POST',
    data: params
  })
}

// 编辑 - 管理
export function updateYsManageBudgetData(params) {
  return request({
    url: '/ysManageBudgetData/updateYsManageBudgetData',
    method: 'POST',
    data: params
  })
}

// 导出 - 管理
export function exportExcelYsManageBudgetDatademo(params) {
  return request({
    url: '/ysManageBudgetData/exportExcelYsManageBudgetData',
    method: 'POST',
    params,
    responseType: 'blob'
  })
}

// 导出模板 - 业务
export function exportExcelYsBusinessBudgetDataDemo(params) {
  return request({
    url: '/ysBusinessBudgetData/exportExcelYsBusinessBudgetDataDemo',
    method: 'POST',
    data: params,
    responseType: 'blob'
  })
}

// 导出模板 - 管理
export function exportExcelYsManageBudgetDataDemo(params) {
  return request({
    url: '/ysManageBudgetData/exportExcelYsManageBudgetDataDemo',
    method: 'POST',
    data: params,
    responseType: 'blob'
  })
}

// 导入 - 业务
export function importExcelYsBusinessBudgetData(params, data) {
  return request({
    url: `/ysBusinessBudgetData/importExcelYsBusinessBudgetData/${params.year}`,
    method: 'POST',
    data
  })
}

// 导入 - 管理
export function importExcelYsManageBudgetData(params, data) {
  return request({
    url: `/ysManageBudgetData/importExcelYsManageBudgetData/${params.year}`,
    method: 'POST',
    data
  })
}

// 完成编制
export function finishOrganization(params) {
  return request({
    url: `/ysOrganization/finishOrganization/${params.year}`,
    method: 'GET'
  })
}

// 取消发布
export function cancelRelease(params) {
  return request({
    url: `/ysOrganization/cancelRelease/${params.id}`,
    method: 'GET'
  })
}

